package com.axonactive;

import java.util.ArrayList;
import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Stateless
public class BookDao {
	@PersistenceContext
	EntityManager em;
	public List<Book> getBooks()
	{
		return em.createQuery("select b from Book b", Book.class).getResultList();
	}
	
	public void saveBooks(Book b)
	{
		em.persist(b);
	}
}
